package org.zgr.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import common.entity.book.SourceInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import common.entity.rank.GoodsHotWithMonth;
import org.zgr.service.SourceService;
import org.zgr.service.record.RecordGoodHotWithMonth;

import java.util.List;

/**
 * @Author: 郑国荣
 * @Date: 2024-04-06-18:10
 * @Description:
 */
@RestController
@RequestMapping("/hot")
public class RecommendPageController {

    @Autowired
    private SourceService sourceService;
    @Autowired
    private RecordGoodHotWithMonth recordGoodHotWithMonth;
    @SaIgnore
    @GetMapping("get_source_list")
    public List<SourceInfo> getSourceList(){
        return sourceService.getSourceInfoList();
    }

    @SaIgnore
    @GetMapping("get_goods_hot")
    public GoodsHotWithMonth getGoodsHot(){
        return recordGoodHotWithMonth.getHotGoodsWithMonthById();
    }

    @SaIgnore
    @GetMapping("create_redis_sort_set")
    public boolean createRedisSortSet(){
        return recordGoodHotWithMonth.createRedisSortSet("1", 1);
//        return false;
    }
}
